﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Data;
using Entities;
namespace Business
{
   public class SachService
    {
        public static DataTable GetSachTable()
        {
            DataTable kq = new DataTable();
            kq = Data.ConvertTo.ListToDataTable(SachRepository.GetSachList());
            return kq;
        }
       public static List<SachDTO> GetSachList()
       {
           return SachRepository.GetSachList();
       }

       public static SachDTO GetSachByMaSach(int maSach)
       {
           SachDTO kq = new SachDTO();
           kq = SachRepository.GetSachByMaSach(maSach);
           return kq;
       }
       public static int GetSoLuongByMaSach(int maSach)
       {
           return SachRepository.GetSachByMaSach(maSach).SoLuong;
       }
       public static List<SachDTO> SearchByTenSach(string tenSach)
       {
           return SachRepository.SearchByTenSach(tenSach);
       }
    }
}
